1 Introduction

Placing images in RMarkdown documents can be difficult. Here are two approaches.

2 Method 1

Easiest if image is in same directory as your RMarkdown file.

Here I use the code:

![The Count and Friends](Sesame-Street-optimize.gif)

The Count and Friends

2.1 Method 1A (add width)

![The Count and Friends](Sesame-Street-optimize.gif){ width=20% }

Note the space before and after the { and }.

The Count and Friends

3 Method 2

This method uses code in an R chunk. You could set echo = FALSE to hide this chunk in the final RMarkdown document.

I use the outwidth = option to set the size of the image: {r out.width = "20%"}

knitr::include_graphics("Sesame-Street-optimize.gif")